/**  
 * @Title: ObjectFactoryExample.java  
 * @Package com.blog4java.mybatis  
 * @Description: TODO(用一句话描述该文件做什么)  
 * @author suyuhao  
 * @date 2025-05-27 09:00:31   
 */
package com.blog4java.mybatis;

import java.util.Arrays;
import java.util.List;
import java.util.Map;

import org.apache.ibatis.reflection.factory.DefaultObjectFactory;
import org.apache.ibatis.reflection.factory.ObjectFactory;
import org.junit.Test;

/**  
* @ClassName: ObjectFactoryExample  
* @Description: 使用ObjectFactory创建对象的案例
* @author suyuhao  
* @date 2025-05-27 09:00:31
*/
public class ObjectFactoryExample {
    @Test
    public void testObjectFactory() {
        ObjectFactory objectFactory = new DefaultObjectFactory();
        List<Integer> list = objectFactory.create(List.class);
        Map<String,String> map = objectFactory.create(Map.class);
        list.addAll(Arrays.asList(1, 2, 3));
        map.put("test", "test");
        System.out.println(list);
        System.out.println(map);
    }
}
